//
//  CMMyHelpDetailCtrl.m
//  CreditManger
//
//  Created by chaiyanan on 15/11/2.
//  Copyright © 2015年 jinxin. All rights reserved.
//

#import "CMMyHelpDetailCtrl.h"
#import "CMLoginManager.h"
#import "CMGetContentInfo.h"
#import "CMGetContentParam.h"
#import "CMGetContentParser.h"

@interface CMMyHelpDetailCtrl ()
<UIWebViewDelegate>

@property (nonatomic, weak) IBOutlet UIWebView *myWebView;

@end

@implementation CMMyHelpDetailCtrl

- (void)viewDidLoad {
    [super viewDidLoad];
    [self requestToGetHelpContent];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - webView Delegate

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
    return YES;
}

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    
}

- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
    
}

#pragma mark - net method

- (void)requestToGetHelpContent
{
    CMGetContentParam *param = [[CMGetContentParam alloc]init];
    param.token = [CMLoginManager sharedCMLoginManager].currentUserInfo.token;
    param.uid = [CMLoginManager sharedCMLoginManager].currentUserInfo.uid;
    param.hid = self.itemInfo.uid;
    
    CMGetContentParser *parser = [[CMGetContentParser alloc]init];
    [NetCenter getDataFromURL:Method_getContent params:param parser:parser result:^(ParserResult *myResult) {
        if (myResult.code==0)
        {
            CMGetContentInfo *info = (CMGetContentInfo *)myResult.result;
            LLog(@"help----%@",info.content);
           
        }
        else
        {
            DISSMISS_ERR(myResult.message);
        }
        
    } failure:^(NSError *error) {
        DISSMISS_ERR([error description]);
    }];
}


@end
